#define _CRT_SECURE_NO_WARNINGS  1

#include <iostream>
#include <string>


using namespace std;
int main()
{
	string s;
	getline(cin, s);
	int num = 0;
	for (int i = 0; i < s.length(); i++)
	{
		if (s[i] == '"')
		{
			i++;
			while (s[i] != '"')
			{
				i++;
			}
		}
		else if (s[i] == ' ')
			num++;
	}
	cout << num + 1 << endl;
	for (int i = 0; i < s.length(); i++)
	{
		if (s[i] == '"')
		{
			i++;
			while (s[i] != '"')
			{
				cout << s[i];
				i++;
			}
		}
		else if (s[i] == ' ')
		{
			cout << endl;
		}
		else
			cout << s[i];
	}
}

